#include "ALPAGAST.h"

CALPAGAST::CALPAGAST()
{
}

CALPAGAST::CALPAGAST(CALStepItem* pStepItem)
{
	m_pStepItem = pStepItem;
}

CALPAGAST::~CALPAGAST()
{
}


void CALPAGAST::test()
{

}
void CALPAGAST::convert()
{
	if (m_pStepItem == NULL) return;

	try
	{
		CALSIPAGAST* pStepItem = (CALSIPAGAST*)m_pStepItem;

		if (pStepItem != NULL)
		{
			int nThreshold = pStepItem->GetItemThreshold();

			bool bNonmaxSuppression = pStepItem->GetItemNonmaxSuppression();

			AgastFeatureDetector::DetectorType type = (AgastFeatureDetector::DetectorType)pStepItem->GetItemType();

			std::vector<KeyPoint> keyPoints;
			Ptr<AgastFeatureDetector> fast = AgastFeatureDetector::create(nThreshold, bNonmaxSuppression, type);
			fast->detect(m_srcMat, keyPoints);

			drawKeypoints(m_srcMat, keyPoints, m_dstMat, Scalar::all(255), DrawMatchesFlags::DEFAULT);

			SetDstType(AL_DST_Mat_One);
		}
		
	}
	catch (...)
	{

	}
}

void CALPAGAST::convert(const Mat &src, Mat &dst)
{

}